#pragma once
#include "LJV7_IF.h"
#include "LJV7_ErrorCode.h"
#include "DeviceData.h"
//#include "afxwin.h"
//#include "afxcmn.h"

//using namespace std;
class CSingleFuncDlg
{
public:
	CSingleFuncDlg(void);
	virtual ~CSingleFuncDlg();

private:
	int m_xvCurrentDeviceID;
	int m_xvHeadNum;
	int m_xvXRange;
	int m_xvBinning;
	int m_xvXCompression;
	BOOL m_xvIsEnvelope;
	BOOL m_xvIsCountOnly;
	BOOL m_xvIsStartTimer;
	string m_strCommandLog;
	string m_strSaveFilePath;
	string m_xvSaveFilePath;	
	CDeviceData m_aDeviceData[LJV7IF_DEVICE_COUNT];
	int m_anProfReceiveCnt[LJV7IF_DEVICE_COUNT];
	static LJV7IF_PROFILE_INFO m_aProfileInfo[];

	// Storage structure (storage status)
	static const int STORAGE_INFO_STATUS_EMPTY    = 0;
	static const int STORAGE_INFO_STATUS_STORING  = 1;
	static const int STORAGE_INFO_STATUS_FINISHED = 2;

	// Storage structure (storage target)
	static const int STORAGE_INFO_TARGET_DATA    = 0;
	static const int STORAGE_INFO_TARGET_PROFILE = 2;
	static const int STORAGE_INFO_TARGET_BATCH   = 3;
	
	// Maximum Communication Data Size
	static const DWORD LJV7IFEX_MAXIMUM_READ_DATA_SIZE = 1024 * 1024;
	static const int WRITE_DATA_SIZE = 20 * 1024;

	static const int TIMER_ID    = 100;
	static const int TIMER_ELASP = 200;

	
	
public:
	 void OnBnClickedBtnStarthighspeeddatacommunication();
	 void OnBnClickedBtnStophighspeeddatacommunication();
	 void OnBnClickedBtnInitialize();
	 void OnBnClickedBtnEthernetopen();
	 void OnBnClickedBtnHighspeeddataethernetcommunicationinitalize();
	 void OnBnClickedBtnPrestarthighspeeddatacommunication();

	 void OnBnClickedBtnGetprofile();
	 void OnBnClickedSaveProfile();
	 static void ReceiveHighSpeedData(BYTE* pBuffer, DWORD dwSize, DWORD dwCount, DWORD dwNotify, DWORD dwUser);
	 static void CountProfileReceive(BYTE* pBuffer, DWORD dwSize, DWORD dwCount, DWORD dwNotify, DWORD dwUser);
	 int GetOneProfileDataSize();
};